package FMainController;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;

import AdminController.AdminExe.AdminExeBean;
import Connect.connector;

public class MOldActionDAO {
	Connection conn = null;
	PreparedStatement pstmt = null;
	ResultSet rs = null;
	
	public MOldActionBean[] getImList(){
		conn = connector.getConnection();
		ArrayList <MOldActionBean> result = new ArrayList<MOldActionBean>();
		
		try{
			
			String sql = "select Bbp_Photo from BABYPHOTO order by ID";
			
			pstmt = conn.prepareStatement( sql );
			
			rs = pstmt.executeQuery();
			
			while(rs.next()){
				MOldActionBean mobean = new MOldActionBean();
				
				mobean.setBbp_photo(rs.getString(1));
				System.out.println("사진"+rs.getString(1));
				result.add(mobean);
			}
			
		}catch(Exception e){
			e.printStackTrace();
		}finally{
			connector.releaseConnection(conn, pstmt, rs);
		}
		return result.toArray(new MOldActionBean[0]);
	}
}
